{% extends "main/base.html" %}
{% block title %}登录{% endblock %}
{% block body %}
  <div class="row">
    <div class="col-md-4"></div>
    <div class="col-md-4">
      <h1 class="text-center">登录</h1>
      <form method="POST" action="{{ url_for('.login') }}">
        {{ form.csrf_token }}
        {{ form.hidden_tag }}
        <div class="form-group">
          {{ form.username.label }}
          {% if form.username.errors %}
            {% for e in form.username.errors %}
              <p class="help-block">{{ e }}</p>
            {% endfor %}
          {% endif %}
          {{ form.username(class_='form-control') }}
        </div>
        <div class="form-group">
          {{ form.password.label }}
          {% if form.password.errors %}
            {% for e in form.password.errors %}
              <p class="help-block">{{ e }}</p>
            {% endfor %}
          {% endif %}
          {{ form.password(class_='form-control') }}
        </div>
        <div class="form-group">
          {{ form.remember.label }}
          {% if form.remember.errors %}
            {% for e in form.remember.errors %}
              <p class="help-block">{{ e }}</p>
            {% endfor %}
          {% endif %}
          {{ form.remember() }}
        </div>
        <input class="btn btn-primary" type="submit" value="登录">
      </form>
      <hr><!--水平线-->      
    </div>
  </div>
{% endblock %}